03. Primary Keys & Foreign Keys

Primary Keys & Foreign Keys

ND004 C01 L02 03 Primary And Foreign Keys

Takeaways

Primary Key

  • The primary key is the unique identifier for the entire row, referring to one or more columns.
  • If there are more multiple columns for the primary key, then the set of primary key columns is known as a composite key .

Foreign Key

  • A primary key in another (foreign) table.
  • Foreign keys are used to map relationships between tables.

Relationships between tables are encoded using…

SOLUTION: Foreign Keys

When a primary key consists of more than 1 column, we call the set of primary key columns a…

SOLUTION: Composite Key